/**
 * @param {Object} data
 * 各个 数据请求 方法
 */
import network from './network.js'
//发送短信
const getSms = function (data) {
  return network({
    url: '/gp-boot/gp/api/sms',
    data: data,
    method: 'post',
  })
}
//用户注册
const Registered = function (data) {
  return network({
    url: '/gp-boot/gp/api/registered',
    data: data,
    method: 'post',
  })
}
//手机号登录接口
const phoneLogin = function (data) {
  return network({
    url: '/gp-boot/gp/api/phoneLogin',
    data: data,
    method: 'post',
  })
}
const login = function (data) {
  return network({
    url: '/gp-boot/gp/api/login',
    data: data,
    method: 'post',
  })
}
//群团列表
const gpGpinfoList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpGpinfo/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
  })
}
//群团详情
const gpGpinfo = function (id) {
  return network({
    url: '/gp-boot/gp/api/gpGpinfo/get/' + id,
    method: 'get',
  })
}
//群团添加
const gpGpinfoAdd = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpGpinfo/listGpResourceByMainId',
    method: 'get',
    data: data,
    auth: true,
  })
}
//群团免登
const getGroupUrl = function (id) {
  return network({
    url: '/gp-boot/gp/login/getGroupUrl/g' + id,
    method: 'get',
    auth: true,
  })
}

//阵地免登
const getFrontUrl = function (id) {
  return network({
    url: '/gp-boot/gp/login/getFrontUrl/f' + id,
    method: 'get',
    auth: true,
  })
}
//活动列表
const gpMoveList = function (pageSize, pageNo, data, flag) {
  flag = flag || 0
  console.log('flag', flag)
  return network({
    url: '/gp-boot/gp/api/gpMove/list?pageSize=' + pageSize + '&pageNo=' + pageNo + '&flag=' + flag,
    method: 'get',
    data: data,
  })
}
//我的活动
const myMoveList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpMove/myList?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
    auth: true,
  })
}
//活动详情
const gpMoveInfo = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpMove/info',
    method: 'post',
    param: data,
  })
}
//活动人数
const gpMovedatePerson = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpMove/gpMovedatePerson',
    method: 'post',
    param: data,
  })
}
//活动签到
const checkGpMovedate = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpMove/checkGpMovedate',
    method: 'post',
    param: data,
    auth: true,
  })
}
//个人活动预约
const addGpMovedate = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpMove/addGpMovedate',
    method: 'post',
    data: data,
    auth: true,
  })
}
//单位活动预约
const addGpMovedatecom = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpMove/addGpMovedatecom',
    method: 'post',
    data: data,
    auth: true,
  })
}
//视频标签
const gpTagList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpTag/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
  })
}
//视频管理
const gpVideoList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpVideo/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
  })
}
//视频信息
const gpVideoInfo = function (id) {
  return network({
    url: '/gp-boot/gp/api/gpVideo/get/' + id,
    method: 'post',
  })
}
//课程列表
const gpClassesList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpClasses/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
  })
}
//课程信息
const gpClassesInfo = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpClasses/info',
    data: data,
    method: 'post',
  })
}
//活动签到
const checkGpClassesdate = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpClasses/checkGpClassesdate',
    data: data,
    method: 'post',
  })
}
//活动预约
const addGpClassesdate = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpClasses/addGpClassesdate',
    data: data,
    method: 'post',
  })
}
//群团用户足迹-活动
const gpUsertraceWork = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUsertrace/work',
    data: data,
    method: 'get',
  })
}
//群团用户足迹-捐赠
const gpUsertraceDonation = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUsertrace/donation',
    data: data,
    method: 'get',
  })
}
//群团用户建议-提交
const gpUseradviseSubmit = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUseradvise/submit',
    data: data,
    method: 'get',
  })
}
//群团用户建议-详情
const gpUseradviseInfo = function (id) {
  return network({
    url: '/gp-boot/gp/api/gpUseradvise/get/' + id,
    method: 'get',
  })
}
//群团用户建议-撤销
const gpUseradviseCancel = function (id) {
  return network({
    url: '/gp-boot/gp/api/gpUseradvise/cancel/' + id,
    method: 'post',
    auth: true,
  })
}
//群团用户建议-列表
const gpUseradviseList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpUseradvise/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
  })
}
//用户编辑
const gpUserEdit = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUser/edit',
    method: 'PUT',
    data: data,
    auth: true,
  })
}
//用户爱好信息
const gpInterestsInfo = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpInterests/listGpUserinterestsByMainId',
    data: data,
    method: 'get',
  })
}
//用户爱好列表
const gpInterestsList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpInterests/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
  })
}
//阅读消息
const readMessage = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpMessage/readMessage',
    data: data,
    method: 'get',
  })
}
//总消息列表
const gpMessageList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpMessage/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
  })
}
//用户消息列表
const getUserMessageList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpMessage/getUserMessageList?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
  })
}
//根据用户id获取消息条数
const getMessageNumber = function () {
  return network({
    url: '/gp-boot/gp/api/gpMessage/getMessageNumber',
    method: 'get',
  })
}
//入群资料类别
const gpResourcetypeList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpResourcetype/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
  })
}
//群团添加
const gpUserGpapply = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUserGpapply/add',
    data: data,
    method: 'post',
    auth: true,
  })
}
//群团申请记录
const gpUserGpapplyList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpUserGpapply/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    method: 'get',
    data: data,
    auth: true,
  })
}
//修改密码
const updatePwd = function (data) {
  return network({
    url: '/gp-boot/gp/api/updatePwd',
    method: 'post',
    data: data,
    auth: true,
  })
}
//修改密码
const gpUserInfo = function () {
  return network({
    url: '/gp-boot/gp/api/gpUser/info',
    method: 'post',
    auth: true,
  })
}
//视频操作次数
const addUserVideoOperateTimes = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUserVideoOperateTimes/addUserVideoOperateTimes',
    method: 'post',
    param: data,
    auth: true,
  })
}
//获取用户视频操作次数
const getUserVideoOperateTimes = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUserVideoOperateTimes/getUserVideoOperateTimes',
    method: 'get',
    param: data,
    auth: true,
  })
}
//提交我有话说
const gpUseradvisesubmit = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUseradvise/submit',
    data: data,
    method: 'get',
    auth: true,
  })
}
//获取我有话说的列表
const gpUseradviselist = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpUseradvise/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    data: data,
    method: 'get',
    auth: true,
  })
}
//获取我有话说的列表
const gpFrontlist = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpFront/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    data: data,
    method: 'get',
    auth: true,
  })
}
//获取新闻详情
const gpNewsDetail = function (id) {
  return network({
    url: '/gp-boot/gp/api/gpNews/queryById',
    param: { id: id },
    method: 'get',
  })
}
//获取新闻总操作
const gpNewsOperateTimes = function (newsId) {
  return network({
    url: '/gp-boot/gp/api/gpUserNewsOperateTimes/getNewsOperateTimes',
    param: { newsId: newsId },
    method: 'get',
  })
}
//获取活动总操作次数
const getMoveOperateTimes = function (moveId) {
  return network({
    url: '/gp-boot/gp/api/gpUserMoveOperateTimes/getMoveOperateTimes',
    param: { moveId },
    method: 'get',
  })
}
//新闻-分页列表查询
const gpNewsList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpNews/vlist?pageSize=' + pageSize + '&pageNo=' + pageNo,
    data: data,
    method: 'get',
  })
}
//新闻操作
const addUserNewsOperateTimes = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUserNewsOperateTimes/addUserNewsOperateTimes',
    param: data,
    method: 'post',
    auth: true,
  })
}
//活动操作
const addUserMoveOperateTimes = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUserMoveOperateTimes/addUserMoveOperateTimes',
    param: data,
    method: 'post',
    auth: true,
  })
}
//获取字典数据
const getDictItems = function (data, type) {
  return network({
    url: '/gp-boot/gp/api/dict/getDictItems/' + type,
    param: data,
    method: 'get',
  })
}
//用户新闻操作次数-取消点赞
const cancelUserNewsDZ = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUserNewsOperateTimes/cancelUserNewsDZ',
    param: data,
    method: 'post',
    auth: true,
  })
}
//新闻操作
const getNewsOperateTimes = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUserNewsOperateTimes/getNewsOperateTimes',
    param: data,
    method: 'get',
    auth: true,
  })
}
//场景信息-分页列表查询
const gpSceneList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpScene/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    data: data,
    method: 'get',
    auth: true,
  })
}
const getGroupUrls = function (id) {
  return network({
    url: '/gp-boot/gp/login/getGroupUrls/g' + id,
    method: 'get',
    auth: true,
  })
}
//附近阵地
const getFrontList = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpFront/getFrontList',
    data: data,
    method: 'post',
  })
}
//我的捐赠
const gpUsertraceList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpUsertrace/donation?pageSize=' + pageSize + '&pageNo=' + pageNo,
    data: data,
    method: 'get',
    auth: true,
  })
}

const getWordList = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpWord/list',
    method: 'get',
    param: data,
  })
}
const getHotWordList = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpWord/hotList',
    method: 'get',
    param: data,
  })
}

//企业认证信息添加
const addgpUsercom = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUsercom/add',
    data: data,
    method: 'post',
    auth: true,
  })
}

//企业认证信查询
const getgpUsercom = function () {
  return network({
    url: '/gp-boot/gp/api/gpUsercom/get',
    method: 'get',
    auth: true,
  })
}
//预览图片——需登录
// const getSelfImgUrl = function() {
// 	return network({
// 		url: "/gp-boot/sys/common/selfStatic/",
// 		method: "get",
// 		auth: true
// 	})
// }
//预览图片
const getImgUrl = function () {
  return network({
    url: '/gp-boot/sys/common/static/',
    method: 'get',
  })
}
//评价评论
const movedateComment = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpMove/movedateComment',
    data: data,
    method: 'POST',
    auth: true,
  })
}
//获取我有话说的列表
const gpUseradviseAlllist = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/gpUseradvise/listAll?pageSize=' + pageSize + '&pageNo=' + pageNo,
    data: data,
    method: 'get',
  })
}
//名师管理-分页列表查询
const gpTeacherList = function (pageSize, pageNo, data) {
  return network({
    url: '/gp-boot/gp/api/tRunResourcesBase/list?pageSize=' + pageSize + '&pageNo=' + pageNo,
    data: data,
    method: 'get',
    auth: false,
  })
}
//教师荣誉称号
const gpTeacherCher = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpTeacher/listGpTeachertitleByMainId',
    data: data,
    method: 'get',
    auth: true,
  })
}
//建议--评价评论
const adviseComment = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUseradvise/adviseComment',
    data: data,
    method: 'post',
    auth: true,
  })
}
//用户建议操作次数-增加1次-1.阅读2.点赞3.分享
const addUserUseradviseOperateTimes = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUserUseradviseOperateTimes/addUserUseradviseOperateTimes',
    param: data,
    method: 'post',
    auth: true,
  })
}
//获取建议总操作次数
const getUseradviseOperateTimes = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpUserUseradviseOperateTimes/getUseradviseOperateTimes',
    param: data,
    method: 'get',
    auth: true,
  })
}
//微信公众号
const getSignature = function (data) {
  return network({
    url: '/gp-boot/gp/api/wxpay/signature?url=' + data.url,
    method: 'get',
    data: data,
    auth: true,
  })
}
//获取自己的分享点赞数据
const getUserNewsOperateTimes = function (id) {
  return network({
    url: '/gp-boot/gp/api/gpUserNewsOperateTimes/getUserNewsOperateTimes?newsId=' + id,
    method: 'get',
    auth: true,
  })
}

//获取自己的分享活动数据
const getUserMoveOperateTimes = function (id) {
  return network({
    url: '/gp-boot/gp/api/gpUserMoveOperateTimes/getUserMoveOperateTimes?moveId=' + id,
    method: 'get',
    auth: true,
  })
}
const addXHXFtoken = function (token) {
  const data = { token }
  return network({
    url: '/gp-boot/gp/api/hzdjLogin',
    data: data,
    method: 'post',
  })
}
const hzzghLogin = function (data) {
  return network({
    url: '/gp-boot/gp/api/hzzghLogin',
    data: data,
    method: 'post',
  })
}

const autoLoginx = function (data) {
  return network({
    url: '/gp-boot/gp/api/autoLogin',
    data: data,
    method: 'post',
  })
}

const postDayVisits = function (userFrom, flag) {
  const url = '/gp-boot/gp/api/gpVisits/visit/' + userFrom + '?flag=' + flag
  console.log('url', url)
  return network({
    url: url,
    data: {},
    method: 'post',
  })
}

const postDayVisitsUrl = function (url, title, type) {
	let url2 = encodeURIComponent(url)
	let title2 = encodeURIComponent(title)
	const _url = '/gp-boot/gp/api/gpVisits/visitUrl?url=' + url2 + '&title=' + title2 +'&type='+type

	return network({
		url: _url,
		data: {},
		method: 'post',
	})
}

const postAppVisit = function (type) {
  const url = '/gp-boot/gp/api/gpVisits/appVisit?type=' + type
  return network({
    url: url,
    data: {},
    method: 'post',
    auth: true,
  })
}

//阵地申请
const tRunPossyAduitRecord = function (data) {
  return network({
    url: '/gp-boot/gp/api/tRunPossyAduitRecord/add',
    data: data,
    method: 'post',
    auth: true,
  })
}
//我的阵地使用记录
const mygetFrontList = function (pageNo, pageSize) {
  return network({
    url: '/gp-boot/gp/api/tRunPossyAduitRecord/list?pageNo=' + pageNo + '&pageSize=' + pageSize,
    method: 'get',
    auth: true,
  })
}
//用户投票-是否可投票
const canVote = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpVote/canVote',
    param: data,
    method: 'post',
    auth: true,
  })
}
//用户投票详情
const voteInfo = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpVote/listGpVoteoptionByMainId',
    data: data,
    method: 'get',
    auth: true,
  })
}
//用户投票-投票
const addVote = function (data) {
  return network({
    url: '/gp-boot/gp/api/gpVote/vote',
    data: data,
    method: 'post',
    auth: true,
  })
}
//投票管理-分页列表查询
const getvoteList = function (pageNo, pageSize, data) {
  return network({
    url: '/gp-boot/gp/api/gpVote/list?pageNo=' + pageNo + '&pageSize=' + pageSize,
    data: data,
    method: 'get',
    auth: true,
  })
}
//广告分页列表查询
const getadList = function (pageNo, pageSize, data) {
  return network({
    url: '/gp-boot/gp/api/gpAd/list?pageNo=' + pageNo + '&pageSize=' + pageSize,
    data: data,
    method: 'get',
    auth: true,
  })
}

export {
  getSms,
  phoneLogin,
  Registered,
  gpGpinfoList,
  gpGpinfo,
  gpGpinfoAdd,
  getGroupUrl,
  gpMoveList,
  gpMoveInfo,
  checkGpMovedate,
  addGpMovedate,
  gpVideoList,
  gpVideoInfo,
  gpClassesList,
  gpClassesInfo,
  checkGpClassesdate,
  addGpClassesdate,
  gpTagList,
  gpUsertraceWork,
  gpUsertraceDonation,
  gpUseradviseSubmit,
  gpUseradviseInfo,
  gpUseradviseList,
  gpUserEdit,
  gpInterestsInfo,
  gpInterestsList,
  readMessage,
  gpMessageList,
  getUserMessageList,
  getMessageNumber,
  gpResourcetypeList,
  gpUserGpapply,
  gpUserGpapplyList,
  updatePwd,
  gpUserInfo,
  addUserVideoOperateTimes,
  getUserVideoOperateTimes,
  gpUseradvisesubmit,
  gpUseradviselist,
  gpFrontlist,
  gpNewsDetail,
  gpNewsOperateTimes,
  gpNewsList,
  addUserNewsOperateTimes,
  getDictItems,
  cancelUserNewsDZ,
  getNewsOperateTimes,
  gpSceneList,
  getGroupUrls,
  addGpMovedatecom,
  getFrontList,
  gpUsertraceList,
  gpMovedatePerson,
  getWordList,
  getHotWordList,
  addgpUsercom,
  getgpUsercom,
  myMoveList,
  // getSelfImgUrl,
  getImgUrl,
  movedateComment,
  gpUseradviseAlllist,
  gpTeacherList,
  gpTeacherCher,
  login,
  adviseComment,
  addUserUseradviseOperateTimes,
  getUseradviseOperateTimes,
  getSignature,
  addXHXFtoken,
  hzzghLogin,
  getUserNewsOperateTimes,
  postDayVisits,
  postDayVisitsUrl,
  gpUseradviseCancel,
  tRunPossyAduitRecord,
  mygetFrontList,
  canVote,
  voteInfo,
  addVote,
  getvoteList,
  postAppVisit,
  getFrontUrl,
  getadList,
  getUserMoveOperateTimes,
  addUserMoveOperateTimes,
  getMoveOperateTimes,
  autoLoginx
}
